package com.xianshijian.oauth.userinfo.dao;

import java.io.Serializable;
import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import com.xianshijian.oauth.userinfo.entity.ClientUser;

public interface ClientUserDao extends JpaRepository<ClientUser, Serializable>, JpaSpecificationExecutor<ClientUser> {
	
	ClientUser findByAccessToken(String accessToken);
	
	ClientUser findByAuthorizationCode(String authorizationCode);
	
	@Query("select t from ClientUser t where t.createTime < ?1")
	List<ClientUser> findByCreateTime(Long createTime);

	

}
